/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pydgtbinvanual")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pydgtbinvanual.findAll", query = "SELECT p FROM Pydgtbinvanual p"),
    @NamedQuery(name = "Pydgtbinvanual.findByPydgtbinvanualid", query = "SELECT p FROM Pydgtbinvanual p WHERE p.pydgtbinvanualid = :pydgtbinvanualid"),
    @NamedQuery(name = "Pydgtbinvanual.findByMonto", query = "SELECT p FROM Pydgtbinvanual p WHERE p.monto = :monto"),
    @NamedQuery(name = "Pydgtbinvanual.findByDescripcion", query = "SELECT p FROM Pydgtbinvanual p WHERE p.descripcion = :descripcion"),
    @NamedQuery(name = "Pydgtbinvanual.findByObservaciones", query = "SELECT p FROM Pydgtbinvanual p WHERE p.observaciones = :observaciones")})
public class Pydgtbinvanual implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pydgtbinvanualid")
    private Integer pydgtbinvanualid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "monto")
    private double monto;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "descripcion")
    private String descripcion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @JoinColumn(name = "scintborganismid", referencedColumnName = "scintborganismid")
    @ManyToOne(optional = false)
    private Scintborganism scintborganismid;
    @JoinColumn(name = "sccntbconvenioid", referencedColumnName = "sccntbconvenioid")
    @ManyToOne(optional = false)
    private Sccntbconvenio sccntbconvenioid;
    @JoinColumn(name = "pydgtbproyecid", referencedColumnName = "pydgtbproyecid")
    @ManyToOne(optional = false)
    private Pydgtbproyec pydgtbproyecid;

    public Pydgtbinvanual() {
    }

    public Pydgtbinvanual(Integer pydgtbinvanualid) {
        this.pydgtbinvanualid = pydgtbinvanualid;
    }

    public Pydgtbinvanual(Integer pydgtbinvanualid, double monto, String descripcion, String observaciones) {
        this.pydgtbinvanualid = pydgtbinvanualid;
        this.monto = monto;
        this.descripcion = descripcion;
        this.observaciones = observaciones;
    }

    public Integer getPydgtbinvanualid() {
        return pydgtbinvanualid;
    }

    public void setPydgtbinvanualid(Integer pydgtbinvanualid) {
        this.pydgtbinvanualid = pydgtbinvanualid;
    }

    public double getMonto() {
        return monto;
    }

    public void setMonto(double monto) {
        this.monto = monto;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    public Scintborganism getScintborganismid() {
        return scintborganismid;
    }

    public void setScintborganismid(Scintborganism scintborganismid) {
        this.scintborganismid = scintborganismid;
    }

    public Sccntbconvenio getSccntbconvenioid() {
        return sccntbconvenioid;
    }

    public void setSccntbconvenioid(Sccntbconvenio sccntbconvenioid) {
        this.sccntbconvenioid = sccntbconvenioid;
    }

    public Pydgtbproyec getPydgtbproyecid() {
        return pydgtbproyecid;
    }

    public void setPydgtbproyecid(Pydgtbproyec pydgtbproyecid) {
        this.pydgtbproyecid = pydgtbproyecid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pydgtbinvanualid != null ? pydgtbinvanualid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pydgtbinvanual)) {
            return false;
        }
        Pydgtbinvanual other = (Pydgtbinvanual) object;
        if ((this.pydgtbinvanualid == null && other.pydgtbinvanualid != null) || (this.pydgtbinvanualid != null && !this.pydgtbinvanualid.equals(other.pydgtbinvanualid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pydgtbinvanual[ pydgtbinvanualid=" + pydgtbinvanualid + " ]";
    }
    
}
